package Models;

import java.util.Date;

public class RecPOTbl {
    private int dvendorID;
    private int dpartNumber;
    private int dqty;
    private int drecomendedQty;
    private int dwarehouseID;
    private Date ddueDate;
    private boolean donPO = false;
    private Hops hop;
    private Malt malt;
    private Yeast yeast;
    private Supplies supply;
    
	public int getDvendorID() {
		return dvendorID;
	}
	public void setDvendorID(int dvendorID) {
		this.dvendorID = dvendorID;
	}
	public int getDpartNumber() {
		return dpartNumber;
	}
	public void setDpartNumber(int dpartNumber) {
		this.dpartNumber = dpartNumber;
	}
	public int getDqty() {
		return dqty;
	}
	public void setDqty(int dqty) {
		this.dqty = dqty;
	}
	public int getDrecomendedQty() {
		return drecomendedQty;
	}
	public void setDrecomendedQty(int drecomendedQty) {
		this.drecomendedQty = drecomendedQty;
	}
	public int getDwarehouseID() {
		return dwarehouseID;
	}
	public void setDwarehouseID(int dwarehouseID) {
		this.dwarehouseID = dwarehouseID;
	}
	public Date getDdueDate() {
		return ddueDate;
	}
	public void setDdueDate(Date ddueDate) {
		this.ddueDate = ddueDate;
	}
	public boolean isDonPO() {
		return donPO;
	}
	public void setDonPO(boolean donPO) {
		this.donPO = donPO;
	}
	public Hops getHop() {
		return hop;
	}
	public void setHop(Hops hop) {
		this.hop = hop;
	}
	public Malt getMalt() {
		return malt;
	}
	public void setMalt(Malt malt) {
		this.malt = malt;
	}
	public Yeast getYeast() {
		return yeast;
	}
	public void setYeast(Yeast yeast) {
		this.yeast = yeast;
	}
	public Supplies getSupply() {
		return supply;
	}
	public void setSupply(Supplies supply) {
		this.supply = supply;
	}
    
    public double getRecPOLineItemPrice(){
        if(this.malt!=null){
            return this.malt.getPOLineItemPrice();
        } else if (this.hop != null){
            return this.hop.getPOLineItemPrice();
        } else if (this.yeast != null){
            return this.yeast.getYeastCost();
        } else if (this.supply != null){
            return supply.getPOLineItemPrice();
        } else {
            return 0;
        }
    }
}
